/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ifs.RnD.revisionRead;

import java.util.Date;

/**
 *
 * @author anaklk
 */
public class Revision {

    String logMsg, author, type;
    long revision;
    Date date;
    RevRecord revRec;
    String recordUrl;
    RevRecord copyComponent;
    String display;

    /**
     * This will initiate a Revision object with its given properties
     * @param revision
     * @param author
     * @param date
     * @param logMsg
     * @param type
     * @param revRec
     */
    public Revision(long revision, String author, Date date, String logMsg, String type, RevRecord revRec) {
        this.logMsg = logMsg;
        this.author = author;
        this.revision = revision;
        this.date = date;
        this.type = type;
        recordUrl = revRec.getRecordUrl();
        copyComponent = revRec.getCopyComponent();
    }

    /**
     * This will initiate a Revision object with its given properties
     * @param revision
     */
    public Revision(long revision) {
        this.revision = revision;
    }

    /**
     * This will initiate a Revision object with its given properties
     * @param revision
     * @param display
     * @param type
     */
    public Revision(String type, String display, long revision) {
        this.type = type;
        this.display = display;
        this.revision = revision;
    }

    /**
     * This will return the revision number
     * @return revision number
     */
    public long getRevision() {
        return revision;
    }

    /**
     * This will return the type of the revision
     * @return type of the revision
     */
    public String getType() {
        return type;
    }

    /**
     * This will return the copy component
     * @return copy component
     */
    public RevRecord getCopyComponent() {
        return copyComponent;
    }

    /**
     * This will return the the author
     * @return author of the revision
     */
    public String getAuthor() {
        return author;
    }

    /**
     * This will return the date of the revision create
     * @return Data of revision
     */
    public Date getDate() {
        return date;
    }

    /**
     * This will return the log msg
     * @return log message of the revision
     */
    public String getLogMsg() {
        return logMsg;
    }

    /**
     * This will return the URL of the record
     * @return
     */
    public String getRecordUrl() {
        return recordUrl;
    }

    /**
     * This will return the string representation of the record
     * @return string containg info
     */
    @Override
    public String toString() {
        return author + "  " + revision + " " + logMsg;
    }
}
